﻿using Dapper.Contrib.Extensions;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Gx.Model.Entity
{
    [System.ComponentModel.DataAnnotations.Schema.Table("LK_Goods")] 
    public class LKGoods
    {
        [System.ComponentModel.DataAnnotations.Key]
        private long _id;
        /// <summary>
        /// Id
        /// </summary>
        [Column("Id")]
        public long Id 
        {
            get
            {
                return _id;
            }
            set { _id = value; }
        }


        private string _goodsCode;
        /// <summary>
        /// 商品代码
        /// </summary>
        [Column("GoodsCode")]
        public string GoodsCode
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_goodsCode))
                    _goodsCode = string.Empty;
                return _goodsCode;
            }
            set { _goodsCode = value; }
        }


        private string _goodsName;
        /// <summary>
        /// 商品名称
        /// </summary>
        [Column("GoodsName")]
        public string GoodsName
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_goodsName))
                    _goodsName = string.Empty;
                return _goodsName;
            }
            set { _goodsName = value; }
        }


        private int _goodsTypeId;
        /// <summary>
        /// 商品类型
        /// </summary>
        [Column("GoodsTypeId")]
        public int GoodsTypeId
        {
            get
            {
                return _goodsTypeId;
            }
            set { _goodsTypeId = value; }
        }


        private int _goodsSpecId;
        /// <summary>
        /// 商品规格
        /// </summary>
        [Column("GoodsSpecId")]
        public int GoodsSpecId
        {
            get
            {
                return _goodsSpecId;
            }
            set { _goodsSpecId = value; }
        }


        private decimal _weight;
        /// <summary>
        /// 件重
        /// </summary>
        [Column("Weight")]
        public decimal Weight
        {
            get
            {
                return _weight;
            }
            set { _weight = value; }
        }


        private string _remark;
        /// <summary>
        /// 备注
        /// </summary>
        [Column("Remark")]
        public string Remark
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_remark))
                    _remark = string.Empty;
                return _remark;
            }
            set { _remark = value; }
        }


        private bool _isValid;
        /// <summary>
        /// 是否有效
        /// </summary>
        [Column("IsValid")]
        public bool IsValid
        {
            get
            {
                return _isValid;
            }
            set { _isValid = value; }
        }


        private bool _isDeleted;
        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("IsDeleted")]
        public bool IsDeleted
        {
            get
            {
                return _isDeleted;
            }
            set { _isDeleted = value; }
        }


        private System.DateTime _createTime;
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("CreateTime")]
        public System.DateTime CreateTime
        {
            get
            {
                if (_createTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _createTime;
            }
            set { _createTime = value; }
        }


        private int _createUserId;
        /// <summary>
        /// 创建人id
        /// </summary>
        [Column("CreateUserId")]
        public int CreateUserId
        {
            get
            {
                return _createUserId;
            }
            set { _createUserId = value; }
        }


        private string _createUser;
        /// <summary>
        /// 创建人
        /// </summary>
        [Column("CreateUser")]
        public string CreateUser
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_createUser))
                    _createUser = string.Empty;
                return _createUser;
            }
            set { _createUser = value; }
        }


        private int _modifyUserId;
        /// <summary>
        /// 修改人
        /// </summary>
        [Column("ModifyUserId")]
        public int ModifyUserId
        {
            get
            {
                return _modifyUserId;
            }
            set { _modifyUserId = value; }
        }


        private System.DateTime _modifyTime;
        /// <summary>
        /// 修改时间
        /// </summary>
        [Column("ModifyTime")]
        public System.DateTime ModifyTime
        {
            get
            {
                if (_modifyTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _modifyTime;
            }
            set { _modifyTime = value; }
        }


        private string _modifyUser;
        /// <summary>
        /// 修改人
        /// </summary>
        [Column("ModifyUser")]
        public string ModifyUser
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_modifyUser))
                    _modifyUser = string.Empty;
                return _modifyUser;
            }
            set { _modifyUser = value; }
        }
        [Computed]
        public string TypeName { get; set; }
    }
}

